package com.xx.pinball;

import android.graphics.Bitmap;

import com.xx.pinball.framwork.Game;
import com.xx.pinball.framwork.Screen;

/**
 * @author xx
 *
 */
public class MainMenuScreen extends Screen {
    Bitmap mainmenu, insertCoin;   
    float passedTime = 0;    
    
    public MainMenuScreen(Game game) {
        super(game);
        mainmenu = game.loadBitmap("mainmenu.png");
        insertCoin = game.loadBitmap("insertcoin.png");        
    }
    
    public void update(float deltaTime) {        
        if(game.isTouchDown(0)) { game.setScreen(new GameScreen(game)); return; }
        
        passedTime += deltaTime;        
        game.drawBitmap(mainmenu, 0, 0);
        if((passedTime - (int)passedTime) > 0.5f)
            game.drawBitmap(insertCoin, 160 - insertCoin.getWidth() / 2, 360);        
    }
        
    public void dispose() {        
    }
    
    public void pause() { }    
    public void resume() { }
}
